package com.jic.purchase.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: 建投数据科技(山东)有限公司 
 * @date: 2020-05-28 15:28:18
 */
 @RestController
 @Slf4j
 @RequestMapping("/supplierPurchaseOrderReport")
 @Api(tags = " [供应商采购单报表]控制类-PC")
public class SupplierPurchaseOrderReportController {
//	@Autowired
//	private SupplierPurchaseOrderReportService service;
//
///**
// * 新增记录
// * @param request 新增[供应商采购单报表]请求参数
// * @return SupplierPurchaseOrderReportResponse 新增[供应商采购单报表]响应参数
// * author 建投数据科技(山东)有限公司
// * @date 2020-3-11 20:54:04
// */
//@ApiOperation(value = "新增[供应商采购单报表]记录")
//@PostMapping("/save")
//@ResponseBody
//public RestResult<Long> save(@RequestBody SupplierPurchaseOrderReportRequest request) throws Throwable {
// 		SupplierPurchaseOrderReport supplierPurchaseOrderReport = new SupplierPurchaseOrderReport();
//		BeanUtils.copyProperties(request, supplierPurchaseOrderReport);
//	long flag = service.save(supplierPurchaseOrderReport);
// return RestResult.success(flag);
//}
///**
// * 新增或修改记录
// * @param request 新增或修改[供应商采购单报表]请求参数
// * @return SupplierPurchaseOrderReportResponse 新增或修改[供应商采购单报表]响应参数
// * author 建投数据科技(山东)有限公司
// * @date 2020-3-11 20:54:04
// */
//@ApiOperation(value = "保存或更新[供应商采购单报表]")
//@PostMapping("/saveOrUpdate")
// @ResponseBody
//public RestResult<Long> saveOrUpdate(@Validated @RequestBody SupplierPurchaseOrderReportRequest request) throws Throwable {
// 		SupplierPurchaseOrderReport supplierPurchaseOrderReport = new SupplierPurchaseOrderReport();
//		BeanUtils.copyProperties(request, supplierPurchaseOrderReport);
//	long flag =   service.saveOrUpdate(supplierPurchaseOrderReport);
// return RestResult.success(flag);
//}
///**
// * 删除记录
// * @param request 删除[供应商采购单报表]请求参数
// * @return SupplierPurchaseOrderReportResponse 删除[供应商采购单报表]响应参数
// * author 建投数据科技(山东)有限公司
// * @date 2020-3-11 20:54:04
// */
//@ApiOperation(value = "删除[供应商采购单报表]记录")
//@PostMapping("/delete")
//@ResponseBody
//public RestResult<Long> delete(@RequestBody SupplierPurchaseOrderReportRequest request) throws Throwable {
// 		SupplierPurchaseOrderReport supplierPurchaseOrderReport = new SupplierPurchaseOrderReport();
//		BeanUtils.copyProperties(request, supplierPurchaseOrderReport);
//	long flag = service.deleteByPrimaryKeyLogically(supplierPurchaseOrderReport);
// return RestResult.success(flag);
//}
///**
// * 修改记录
// * @param request 修改[供应商采购单报表]请求参数
// * @return SupplierPurchaseOrderReportResponse 修改[供应商采购单报表]响应参数
// * author 建投数据科技(山东)有限公司
// * @date 2020-3-11 20:54:04
// */
//@ApiOperation(value = "修改[供应商采购单报表]记录")
//@PostMapping("/update")
//@ResponseBody
//public RestResult<Long> update(@RequestBody SupplierPurchaseOrderReportRequest request) throws Throwable {
// 		SupplierPurchaseOrderReport supplierPurchaseOrderReport = new SupplierPurchaseOrderReport();
//		BeanUtils.copyProperties(request, supplierPurchaseOrderReport);
//	long flag = service.updateByPrimaryKeySelective(supplierPurchaseOrderReport);
// return RestResult.success(flag);
//}
///**
// * 单表查询详情信息
// * @param request 查询[供应商采购单报表]详情请求参数
// * @return SupplierPurchaseOrderReportResponse 查询[供应商采购单报表]详情响应参数
// * author 建投数据科技(山东)有限公司
// * @date 2020-3-11 20:54:04
// */
// @PostMapping("/getByPrimaryKey")
// @ApiOperation(value = "查询[供应商采购单报表]详情")
// @ResponseBody
//public RestResult<SupplierPurchaseOrderReportResponse> getByPrimaryKey(@Validated  @RequestBody SupplierPurchaseOrderReportRequest request) {
//	log.info("查询详情请求参数入参，{}", JSONObject.toJSONString(request));
//	if (request!=null && request.getId()!=null) {
//
//		SupplierPurchaseOrderReport supplierPurchaseOrderReport = new SupplierPurchaseOrderReport();
//		BeanUtils.copyProperties(request, supplierPurchaseOrderReport);
//		SupplierPurchaseOrderReport result = service.getByPrimaryKey(supplierPurchaseOrderReport);
//		log.info("查询详情请求参数出参，{}", JSONObject.toJSONString(result));
//		if (result == null) {
//			return RestResult.error(ResponseCode.EXCEPTION, "记录不存在");
//		}
//		SupplierPurchaseOrderReportResponse bo = new SupplierPurchaseOrderReportResponse();
//		BeanUtils.copyProperties(result, bo);
//		return RestResult.success(bo);
//	}
//	log.info("查询详情请求结束");
//	return RestResult.success(new SupplierPurchaseOrderReportResponse());
//}
// /**
//	 * 分页查询
//	*
//	* @param request 分页查询请求参数
//	* @return 分页列表
//	  * @throws Throwable 业务异常和系统异常
//	 */
//@PostMapping("/listPage")
//@ApiOperation(value = " 分页查询列表 ")
//@ResponseBody
//public RestResult<PageResult<SupplierPurchaseOrderReport>> listPage (@RequestBody SupplierPurchaseOrderReportRequest request) throws Throwable {
// SupplierPurchaseOrderReport param = new SupplierPurchaseOrderReport();
// BeanUtils.copyProperties(request, param);
//	param.setDeleteFlag(0);
//return RestResult.success(service.listPageBySelective(param, request.getPageNum(), request.getPageSize()));
//}
//
///**
//	 * SUPPLIER_PURCHASE_ORDER_REPORT 查询列表（不分页）
//	 * @param  request 前端请求参数
// */
// @PostMapping("/listAll")
// @ApiOperation(value = "不分页查询 [供应商采购单报表] ")
// @ResponseBody
// public RestResult<List<SupplierPurchaseOrderReportResponse>>  listSupplierPurchaseOrderReportAllRecord(@RequestBody SupplierPurchaseOrderReportRequest request) throws Throwable {
// 		SupplierPurchaseOrderReport supplierPurchaseOrderReport = new SupplierPurchaseOrderReport();
//		BeanUtils.copyProperties(request, supplierPurchaseOrderReport);
//		supplierPurchaseOrderReport.setDeleteFlag(0);
//		List<SupplierPurchaseOrderReport> list = service.listAllRecord(supplierPurchaseOrderReport);
//			List<SupplierPurchaseOrderReportResponse> responseList = list.stream().map(temp -> {
//			SupplierPurchaseOrderReportResponse bo = new SupplierPurchaseOrderReportResponse();
//			BeanUtils.copyProperties(temp, bo);
//			return bo;
//			}).filter(item -> item != null).collect(Collectors.toList());
//		return RestResult.success(responseList);
//}

}

